import React, { useState } from 'react';
import { View, Text, Button, Alert,  } from 'react-native';
// 定义数据的接口
interface IProps{
  color:string;
  name:string;
}
export default function App() {
  
return (
  // 父组件
  <View>
    <Text>==========</Text>
    <Child color="red" name='张三'/>
    <Text>===============</Text>
  </View>
)
};

function Child(props: IProps) {
  return(
    <View>
      <Text>子组件</Text>
      <Text style={{color:props.color}}>姓名：{props.name}</Text>
    </View>
  )
}


